home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 27 / CU Amiga Magazine's Super CD-ROM 27 (1998)(EMAP Images)(GB)[!][issue 1998-10].iso / CUCD / Programming / JForth / JTools / JReq / FileRequester.f < prev    next >
Encoding:
FORTH Source  |  1992-04-27  |  1.2 KB  |  64 lines

  1. \ File Requester using Cygnus Ed REQ.LIBRARY
  2.  
  3. include? task-req_support.f jreq:req_support.f
  4.  
  5. ANEW TASK-FileRequester.F
  6.  
  7. reqfilerequester myfreq
  8. create freq-dir  DSIZE 2+ allot  freq-dir OFF
  9. create freq-file FCHARS 2+ allot freq-file OFF
  10. create freq-path DSIZE FCHARS + 2+ 2+ allot freq-path OFF
  11.  
  12. : FREQ.INIT
  13.     req?
  14. \ use 1+ to leave room for count byte
  15.     freq-dir  1+  myfreq s! rfr_Dir
  16.     freq-file 1+  myfreq s! rfr_File
  17.     freq-path 1+  myfreq s! rfr_PathName
  18. \
  19. \ set colors
  20.     1 myfreq s! rfr_filenamescolor
  21.     3 myfreq s! rfr_dirnamescolor
  22. ;
  23.  
  24. : FREQ.TERM
  25.     -req
  26. ;
  27.  
  28. : FIX.0STRING ( 0string -- , put count before !!! )
  29.     0count swap 1- c!
  30. ;
  31.  
  32. : EZFILEREQ ( $messaGE -- $path true | false )
  33.     freq.init
  34.     count >dos
  35.     dos0 myfreq s! rfr_title
  36.     myfreq FileRequester()
  37.     IF
  38.         freq-dir 1+ fix.0string
  39.         freq-file 1+ fix.0string
  40.         freq-path 1+ fix.0string
  41.         freq-path true
  42.     ELSE
  43.         false
  44.     THEN
  45.     freq.term
  46. ;
  47.  
  48. : INCL?  ( -- , include a file using the requester )
  49.     " Select file to INCLUDE"    ezfilereq
  50.     IF
  51.         $include interpret
  52.         >newline ." Compilation complete." cr
  53.     THEN
  54. ;
  55.  
  56. ." Installing INCL? on <FKEY-9>" cr
  57.  
  58. ' incl? 9 fkey-vectors !
  59.  
  60. if.forgotten freq.term
  61.  
  62. : AUTO.TERM ( -- ) auto.term freq.term ;
  63.  
  64.